﻿using Gecko.Entities;
using NHibernate;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace Gecko.Respositories
{
    public interface IRepository<T> where T : IEntity
    {
        ISession Session { get; set; }


        IList<T> GetAll();

        T Get(int id);
        IList<T> Get(int start, int limit);

        IList<T> Get(System.Linq.Expressions.Expression<Func<T, bool>> predicate, System.Linq.Expressions.Expression<Func<T, T>> order, bool desc, int start, int limit);

        int Count(System.Linq.Expressions.Expression<Func<T, bool>> predicate);
        void Add(T entity);

        void Update(T entity);
    }
}
